package com.yixing.tech.system.service;

import com.yixing.tech.common.base.BusinessException;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;

/**
 * @author yixing tech
 * at 2022/5/20
 * describe：
 */
public interface IFileService {

    /**
     * 上传文件
     *
     * @param file
     * @return
     * @throws BusinessException
     */
    String uploadFile(MultipartFile file, String name) throws Exception;

    /**
     * 删除文件
     *
     * @param id
     * @throws BusinessException
     */
    void deleteFile(String id) throws BusinessException;

    /**
     * 下载文件
     *
     * @param response
     * @param id
     * @throws BusinessException
     */
    void downloadFile(HttpServletResponse response, String id) throws Exception;


    /**
     * 生产二维码
     *
     * @param content
     * @throws BusinessException
     */
    void buildQRCode(HttpServletResponse response, String content) throws Exception;

}
